﻿using System;
using System.Collections.Generic;
using OpenGL;
using System.Text;

namespace DashBoard
{
	class DashBoardForm : GLForm
	{
		ProgressTreeNode T;
		void SetData()
		{
			T = new ProgressTreeNode("Galaxy project", 0, 1);
			var mathlib = T.AddNode(new ProgressTreeNode("Math Library", 0, 1));
			var vessel = T.AddNode(new ProgressTreeNode("Vessels", 0, 1));
		}
		public DashBoardForm()
			: base()
		{
		}
		List<DashBoardPanel> Panels = new List<DashBoardPanel>();
		protected override void InitGL()
		{
			Panels.Add(new DashBoardPanel());
			Panels[0].X = Panels[0].Y = 0;
			Panels[0].W = Panels[0].H = Height / 2 - 20;
		}
		protected override bool DrawGLScene()
		{
			GL.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
			MakeOrtho();
			foreach (var P in Panels)
				P.Draw();
			return true;
		}
	}
	class DashBoardPanel
	{
		public int X, Y, W, H;

		GLText Header;
		public DashBoardPanel()
		{
			Header = new GLText("Arial");
		}
		public void Draw()
		{
			GL.glTranslated(X, Y, 0);
			GL.glBegin(GL.GL_LINES);
			GL.glVertex2d(0, 0);
			GL.glVertex2d(W, 0);
			GL.glVertex2d(W, H);
			GL.glVertex2d(0, H);
			GL.glEnd();
		}
	}
}